<?php
	class OrderslistModel extends Model {
		protected $tableName='orderslist';
	
	
		public function orderslistbuydone($ordersid){
			$sql='select * from '.$this->tableName.' where orderid='.$ordersid;
			$res=mysql_query($sql) or die(mysql_error());
			$data=array();
			while($row=mysql_fetch_assoc($res)){
				$data[]=$row;
			}
			return $data;
		}
		
		public function orderlistdetail($orderid){
			$sql='select g.*,o.*,b.name as bname,c.name as cname from orderslist as o,goods as g,brand as b,category as c where g.bid=b.id ';
			$sql.='and g.cid=c.id and o.goodsID=g.id and orderid='.$orderid;
			//dump($sql);
			$res=mysql_query($sql) or die(mysql_error());
			$data=array();
				while($row=mysql_fetch_assoc($res)){
					$data[]=$row;
				}
			//dump($data);
			return $data;
		
	}
	}
?>